16 bit Assembly
Home Site Map Instruction Index
The AND Instruction performs and AND action with the second operand on the first operand.
The first operand holds the result of this operation. All matching bits set to 1 in both operands result in that bit being returned as a 1 otherwise the bit is set to 0.
This command has 3 parts, Instruction, then either operand can be a Register or Immediate value or a memory address.
Assembly Sample | Description | 16 bit Machine Code |
---|---|---|
MOV AX, 0x02F2 | ; Assign a value to AX | B8 F2 02 |
MOV BX, 0x0020 | ; Set Address of BX | BB 20 00 |
MOV [BX], 0x0106 | ; Assign a value to address at BX | C7 07 06 01 |
AND AX, 0x00F2 | ; AND a 16 bit immediate to AX | 25 F2 00 |
AND [BX], 0x00F2 | ; AND a 16 bit immediate to an address | 81 27 F2 00 |
AND AH, AL | ; AND two 8 bit Registers | 22 C4 |
AND AX, BX | ; AND two 16 bit Registers | 23 D8 |
AND [BX], AX | ; AND a Register to an Address | 21 07 |
AND AX, [BX] | ; AND an address to a Register | 23 07 |